package com.zzl.alligator.management.monitor.service;

import com.zzl.alligator.management.monitor.domain.QrtzJobDetails;
import org.quartz.SchedulerException;

import java.util.List;
/**
 * (QrtzJobDetails)服务层接口
 *
 * @author zhouziliang
 * @since 2020-07-10
 */
public interface IQrtzJobDetailsService {
    /**
     * 通过ID查询单条数据
     *
     * @param jobName 主键
     * @param jobGroup 组
     * @return 实例对象
     */
    QrtzJobDetails findQrtzJobDetailsById(String jobName, String jobGroup) throws SchedulerException;

   /**
     * 通过实体作为筛选条件查询
     *
     * @param qrtzJobDetails 实例对象
     * @return 对象列表
     */
    List<QrtzJobDetails> findQrtzJobDetailsList(QrtzJobDetails qrtzJobDetails);

    /**
     * 新增数据
     *
     * @param qrtzJobDetails 实例对象
     * @return 实例对象
     */
    void save(QrtzJobDetails qrtzJobDetails) throws SchedulerException, ClassNotFoundException, IllegalAccessException,
            InstantiationException;

    /**
     * 恢复任务
     *
     * @param job
     * @throws SchedulerException
     */
    void resume(QrtzJobDetails job) throws SchedulerException;

    /**
     * 暂停任务
     *
     * @param job
     * @throws SchedulerException
     */
    void pause(QrtzJobDetails job) throws SchedulerException;

    /**
     * 单次执行任务
     *
     * @param qrtzJobDetails 任务信息
     */
    void run(QrtzJobDetails qrtzJobDetails) throws SchedulerException;

    /**
     * 删除任务
     *
     * @param jobGroup 任务组
     * @param jobName 任务名
     */
    void delete(String jobGroup, String jobName) throws SchedulerException;
}